﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Example14.aspx.cs" Inherits="Chapter05.Example14" %>

<!DOCTYPE html>

<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>代码清单 5-14 枚举对象属性</title>
</head>
<body>
    <form>
        <div>
            <script type="text/javascript">
                var myData = {
                    name: "Adam",
                    weather: "sunny",
                    printMessages: function () {
                        document.writeln("Hello " + this.name + ".");
                        document.writeln("Today is " + this.weather + ".");
                    }
                };

                for (var prop in myData) {
                    document.writeln("Name: " + prop + "Value: " + myData[prop]);
                }
            </script>
        </div>
    </form>
</body>
</html>
